package com.sh.learning.demo.javadubboserviceconsumer.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.google.common.collect.Lists;
import com.sh.learning.demo.common.api.user.UserService;
import com.sh.learning.demo.common.domain.UserInfo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author songHai
 * @Classname UserController
 * @Description
 * @Date 2025/4/30 17:23
 */
@RestController
@RequestMapping("/api/user")
public class UserController {

    @Reference
    private UserService userService;


    @GetMapping("findById/{userId}")
    @ResponseBody
    public List<UserInfo> getUserList(@PathVariable String userId) {
        return userService.getUserInfo(userId);
    }

}
